<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>日志列表</title>
    <link href="../../css/bootstrap.min.css" rel="stylesheet">
    <link href="../../font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="../../css/animate.css" rel="stylesheet">
    <link href="../../css/plugins/jQueryUI/jquery-ui-1.10.4.custom.min.css" rel="stylesheet">
    <link href="../../css/style.css" rel="stylesheet">
	<link href="../../css/bootstrap-table.css" rel="stylesheet">
</head>

<body style="background-color: #f3f3f4;">
	<!-- 内容 -->
	<div class="gray-bg">
		<div class="wrapper wrapper-content animated fadeInRight">
            <table id="table"></table>
		</div>
	</div>

    <!-- Mainly scripts -->
    <script src="../../js/jquery-2.1.1.js"></script>

    <!-- jqGrid -->
    <script src="../../js/bootstrap.min.js"></script>
    <script src="../../js/bootstrap-table.js"></script>
	<script src="../../js/bootstrap-table-zh-CN.js"></script>

    <script src="../../js/common.js"></script>

    <script>
        $(function(){
            var $table = $('#table');
            $table.bootstrapTable({
                striped:true,
                url:baseURL + "sysLog/page",
                method:"get",
                toolbar:"#toolbar",
                sidePagination:"server",
                strictSearch: true,
                smartDisplay:true,
                sortable:false,
                showRefresh:true,
                pagination:true,
                queryParams:queryParams,
                onLoadSuccess:function (data) {
                    if (data.total==0){
                        //layer.msg('未查询到数据', {icon: 6,time: 3*1000});
                        $table.bootstrapTable("removeAll");
                    }
                }, //参数
                queryParamsType: "limit", //参数格式,发送标准的RESTFul类型的参数请求
                columns: [{
                    checkbox:true
                }, {
                    field: 'operation',
                    title: '用户操作',
                    align: 'center'
                }, {
                    field: 'method',
                    title: '请求方法',
                    align: 'center'
                } , {
                    field: 'ip',
                    title: 'ip地址',
                    align: 'center'
                } ,{
                    field: 'createtime',
                    title: '创建时间',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return new Date(value).Format('yyyy-MM-dd HH:mm');
                    }
                }]
            });
            /*封装查询参数*/
            function queryParams(params) {
                var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    size: params.limit,   //页面大小
                    current: (params.offset/params.limit)+1  //页码
                };
                return temp;
            }
        });
    </script>
</body>
</html>
